
<style lang="scss" scoped>
.pro-item {
  width: 100%;
  height: 170px;
  background: #fff;
  position: relative;
  box-sizing: border-box;
  padding: 15px;
  margin-bottom: 10px;
  > img {
    width: 140px;
    height: 140px;
    display: block;
    margin-right: 10px;
  }
  .pro-item__box {
    padding: 10px 0;
    width: 100%;
    height: auto;
    position: relative;
    img {
      height: 20px;
      width: auto;
      display: block;
    }
    p {
      font-size: 14px;
      margin-top: 8px;
    }
    .pro-cart {
      width: 100%;
      height: 23px;
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      span {
        font-size: 18px;
        font-weight: bold;
      }
      span.wrap::before {
        content: "";
        width: 20px;
        height: 20px;
        display: inline-block;
        background: url("/static/ethel_img/order_icon_integral.png") center
          center no-repeat;
        background-size: 100% 100%;
        vertical-align: middle
      }
      button {
        outline: none;
        border: none;
        width: 80px;
        display: inline-block;
        position: absolute;
        right: 0px;
        height: 100%;
        line-height: 23px;
        text-align: center;
        &::after {
          content: "";
          display: block;
          width: 12px;
          height: 100%;
          top: 0;
          right: 0;
          position: absolute;
          background: url("/static/ethel_img/home_icon_arrow@2x.png") center
            center no-repeat;
          background-size: 50% 50%;
        }
      }
    }
  }
  .diamond {
    width: 22px !important;
    height: 20px !important;
    display: inline-block !important;
  }
  .proIcon {
    width: 69px;
    height: 15px;
    display: inline-block;
    background: url("/static/ethel_img/welfare_img@2x.png") center center no-repeat;
    background-size: 100% 100%;
    margin-top: 8px;
  }
  .selling_price {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
    text-decoration: line-through;
  }
}
</style>

<template>
  <li class="pro-item flex-display" @click="fnOpenProDetail(item.id, item)">
    <img :src="item.photo">
    <div class="flex-num-one pro-item__box">
      <img src="/static/ethel_img/hblogo.png">
      <p class="text-overflow-2"  style="-webkit-box-orient:vertical !important">{{item.nickname}}</p>
      <span class="proIcon" v-if="item.shop_name == '福利专区'"></span>
      <font class="selling_price">原价{{item.selling_price}}</font>
      <div class="pro-cart">
        <span
          class="theme-color"
          v-if="item.goodsrebate.length && item.goodsrebate[0].pay_type == '微信'"
        >¥{{item.discount_price}}</span>
        <span class="theme-color wrap" v-else>{{item.discount_price}}</span>
        <button class="theme-background f-12">立即体验</button>
      </div>
    </div>
  </li>
</template>
<script>
export default {
  props: {
    item: {
      required: true,
      type: Object,
      default: {}
    }
  },
  created() {},
  methods: {
    fnOpenProDetail(id, item) {
      if(item.label == '免费仪器'){
        this.$router.push('/new/freeget')
      }else{
        this.$emit("fnOpenProDetail", id);
      }

    }
  }
};
</script>
